package design.mode.model.factory.util;


/**
 * @author ldanniel
 * @description 获取bean对象
 * @since jdk11
 */
public class BeanUtils {
    public static  <T> T getBean(Class<T> clazz){
        T bean = null;
        try {
            bean = (T) Class.forName(clazz.getName()).getConstructor().newInstance();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return bean;
    }

}
